/*
 * BuyStuff.java
 *
 * Created on April 5, 2007, 4:57 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.actions;

import Data.*;
import java.sql.SQLException;
import java.util.List;
import javax.servlet.http.*;

/**
 *
 * @author Danny Beutler
 */
public class BuyStuff implements edu.byu.isys413.web.Action{
    
    /** Creates a new instance of BuyStuff */
    public BuyStuff() {
    }
    
    public String process(HttpServletRequest request, HttpServletResponse response) throws Exception {
        HttpSession session = request.getSession();
        TransactionBO transaction = TransactionDAO.getInstance().create();
        session.setAttribute("transaction",transaction);
        
        
        List<ConceptualProductBO> conceptualProductList =null;
        try {
            conceptualProductList = ConceptualProductDAO.getInstance().getAll();
        } catch (SQLException ex) {
            ex.printStackTrace();
        } catch (DataException ex) {
            ex.printStackTrace();
        }
        session.setAttribute("conceptualProductList", conceptualProductList);
        return "buyStuff.jsp";
    }
}
